package com.training.oo.date;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class DateFormateDemo {
	public static void main(String[] args) throws ParseException {
		String s = "2022年5-3";
		
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy年M-d");
		
		Date date = sdf.parse(s);
		
		Calendar c = Calendar.getInstance();
		
		c.setTime(date);
		System.out.println("今年的第"+c.get(Calendar.DAY_OF_YEAR)+"天");
	}

}
